//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
//
// (C) Copyright 2006 Marvell International Ltd.
// All Rights Reserved
//
//------------------------------------------------------------------------------
//
//  File: io.c
//
//  This file implements Littleton input-output routines.
//
#include <windows.h>


UINT16 READ_PORT_USHORT(UINT16 *pAddr)
{
    //on Littleton, we use 16 bit read/write for Ethernet
	UINT16 rv;
    rv =*pAddr;
    return rv;


}


void WRITE_PORT_USHORT(UINT16 *pAddr, UINT16 Data)
{
    //on Littleton, we use 16bit read/write for Ethernet
    *(volatile UINT16 *)pAddr = Data;

}



UCHAR
READ_PORT_UCHAR(
    PUCHAR  Port
    )
{
    return *(volatile UCHAR * const)Port;
}

VOID
WRITE_PORT_UCHAR(
    PUCHAR  Port,
    UCHAR   Value
    )
{
    *(volatile UCHAR * const)Port = Value;
}

VOID
WRITE_REGISTER_USHORT(
    PUSHORT Register,
    USHORT  Value
    )
{
    *(volatile USHORT * const)Register = Value;
}


VOID
WRITE_REGISTER_ULONG(
    PULONG  Register,
    ULONG   Value
    )
{
    *(volatile ULONG * const)Register = Value;
}

USHORT
READ_REGISTER_USHORT(
    PUSHORT Register
    )
{
    return (*(volatile USHORT * const)Register);
}


ULONG
READ_REGISTER_ULONG(
    PULONG  Register
    )
{
    return (*(volatile ULONG * const)Register);
}

VOID WRITE_REGISTER_UCHAR(PUCHAR Register, UCHAR Value)
{
 	*(volatile UCHAR * const)Register = Value;
}